/*
 *  YoucApiError.h
 *  YoucApi
 *
 *  Created by Liam on 12-10-3.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */

#define YoucApiErrorDomain @"YoucApiErrorDomain"

typedef enum {
	YoucApiErrorSuccess = 0,				// 操作成功
	
	YoucApiErrorUserEmailExists = 1000,     // 邮箱已被注册
    YoucApiErrorNicknameExists,				// 昵称已被注册
	YoucApiErrorInvalidUserNameOrPassword,	// 用户名或密码错误
	
	YoucApiErrorAddAttentionIDNotFound = 1100,	// 游戏ID不存在
	YoucApiErrorAddAttentionAlreadyExists,		// 该游戏已添加关注
	
	YoucApiErrorSessionTimeout = 1200,		// session 超时
	YoucApiErrorInvalidSession,				// 非法 session
    
	YoucApiErrorInternalError = 2000,		// 内部错误
	YoucApiErrorInvalidArgument,			// 非法参数
	
	YoucApiErrorRequestTimeOut = 3000,		// 请求超时
	YoucApiErrorRequestConnect,				// 请求连接失败
	YoucApiErrorInvalidResponse,			// 非法返回数据
	YoucApiErrorNoConnection,				// 没有网络连接

	YoucApiErrorUserCancelled = 4000,		// 用户取消
	YoucApiErrorUserNotLogin,				// 用户未登录
	YoucApiErrorUnkown = 9999				// 未知错误
} YoucApiErrorDefine;

@interface YoucApiError : NSError {

}

+ (id)errorWithStringCode:(NSString*)stringCode userInfo:(NSDictionary *)dict;

+ (id)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)dict;

@end